package org.deschutter.exceptions;

import java.math.BigDecimal;

/**
 * User: Berten De Schutter
 * Date: 08-Jul-2009
 * Time: 15:48:29
 */
public class AddPlanetException extends Exception {

    String mistake;
    String x, y, z;
    BigDecimal tick;
    String scanID;

    public AddPlanetException() {
        super();             // call superclass constructor
        mistake = "unknown";
    }

    public AddPlanetException(String err) {
        super(err);     // call super class constructor
        mistake = err;  // save message

    }

    public AddPlanetException(String err, String x, String y, String z, BigDecimal tick, String scanID) {
        super(err);     // call super class constructor
        mistake = err;  // save message
        this.x = x;
        this.y = y;
        this.z = z;
        this.tick = tick;
        this.scanID = scanID;
    }


    public String getError() {
        if (x == null) {
            return getMistake();
        } else {
            return "[ADD PLANET EXCEPTION] " + x + ":" + y + ":" + z + ".  Scan: " + scanID + " Tick: " + tick + ". Reason:" + mistake;
        }
    }

    public String getMistake() {
        return mistake;
    }

    public void setMistake(String mistake) {
        this.mistake = mistake;
    }

    public String getX() {
        return x;
    }

    public void setX(String x) {
        this.x = x;
    }

    public String getY() {
        return y;
    }

    public void setY(String y) {
        this.y = y;
    }

    public String getZ() {
        return z;
    }

    public void setZ(String z) {
        this.z = z;
    }

    public BigDecimal getTick() {
        return tick;
    }

    public void setTick(BigDecimal tick) {
        this.tick = tick;
    }

    public String getScanID() {
        return scanID;
    }

    public void setScanID(String scanID) {
        this.scanID = scanID;
    }
}
